package com.chengzhi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;

/**
 * @author ruanchengzhi
 * @description: gateway
 * @date 2019/9/24 14:47
 */
@SpringBootApplication
@EnableDiscoveryClient
public class ServiceGateWayAppliction {

    /**
     * predicates 断言  after before between cookie header host method query remoteAddr 过滤请求
     * filter addRequestHeader addRequestParameter rewrithPath addResponseHeader stripPrefix retry 请求/响应添加参数
     *
     * @param builder
     * @return
     */
    /*@Bean
    public RouteLocator contomRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("method_route", r -> r.method("GET").uri("http://jd.com"))
                .build();
    }*/

    public static void main(String[] args) {
        SpringApplication.run(ServiceGateWayAppliction.class, args);
    }

}
